const log4js = require('koa-log4');
const logger = log4js.getLogger('routes::staff');
var querystring = require('querystring');
const router = require('koa-router')();
exports = module.exports = router;
const mongodb = require('mongodb');
const ObjectId = mongodb.ObjectId;

const _ = require('lodash');
const util = require(global.prefixPath + '/commons/util');
const site_service = require(global.prefixPath + '/services/site');
const info_service = require(global.prefixPath + '/services/info');

router.get('/:city/ratio', async (ctx, next) => {
    try {
        let params = querystring.parse(ctx.req._parsedUrl.query);
        //  console.log(params.query.split(','));
        let ids = params.query.split(',');
        let result = await info_service.findByIds(ids);
        ctx.state.ratio_info = result;
        //  console.log(result);
    } catch (e) {
        throw e;
    }
    return await ctx.render('ratio/index');
});
